#include "cpu/exec/template-start.h"

#define instr add

static void do_execute() {
    DATA_TYPE result = op_dest->val + op_src->val;

    update_eflags_pf_zf_sf((DATA_TYPE_S)result);
    cpu.eflags.CF = result < op_dest->val;
    cpu.eflags.OF = ((op_dest->val ^ op_src->val ^ 0x80000000) & (result ^ op_src->val)) >> (DATA_BYTE * 8 - 1);

    OPERAND_W(op_dest, result);
    print_asm_template2();
}

make_instr_helper(rm2r)
make_instr_helper(r2rm)
make_instr_helper(i2rm)
make_instr_helper(i2a)

#include "cpu/exec/template-end.h"